<template>
  <view class="totakenexamination">
    <u-list v-if="list && list.length > 0">
      <u-list-item v-for="item in list" :key="item.id">
        <view class="title">
          <text>{{ item.name }}</text>
        </view>
        <view class="content">
          <view class="content-text">
            <text class="one">得分</text>
            <text class="two">{{ item.score }}</text>
          </view>
          <view class="content-text">
            <text class="one">及格线</text>
            <text class="two">{{ item.passingScore }}</text>
          </view>
          <view class="content-text">
            <text class="one">是否及格</text>
            <text class="two">{{ item.state === 1 ? "合格" : "不合格" }}</text>
          </view>
          <!-- <view class="content-text">
            <text class="one">答对</text>
            <text class="two">{{ item.duration }}</text>
          </view> -->
          <!-- <view class="content-text">
            <text class="one">答错</text>
            <text class="two">{{ item.frequency }}</text>
          </view> -->
          <view class="content-text">
            <text class="one">考试时间</text>
            <text class="two">{{ item.answerTime }}</text>
          </view>
          <!-- <view class="content-text">
						<text class="one">状态</text>
						<text class="two">{{item.state}}</text>
					</view> -->
        </view>
        <!-- <view class="tbs">
					<u-button @click="checkGrade" type="primary" text="查看试卷"></u-button>
				</view> -->
      </u-list-item>
    </u-list>
    <u-empty
      v-else
      mode="list"
      text="暂无巡检任务"
      icon="http://cdn.uviewui.com/uview/empty/list.png"
    >
    </u-empty>
  </view>
</template>

<script>
import * as api from "@/api/test.js";

export default {
  data() {
    return {
      list: [],
    };
  },
  methods: {
    checkGrade() {
      uni.navigateTo({
        url: "/pages/checkthetestpaper/checkthetestpaper",
      });
    },
    getList() {
      api.getList({}).then((res) => {
        this.list = res.data;
      });
    },
  },
  onShow() {
    this.getList();
  },
};
</script>

<style lang="scss">
.totakenexamination {
  width: 100%;
  // height: 100%;
  padding: 40rpx 24rpx 65rpx;
  box-sizing: border-box;
  background-color: #f6f6f6 !important;
  .u-list {
    width: 100%;
    .u-list-item {
      width: 702rpx;
      height: 523rpx;
      border-radius: 16rpx;
      padding: 32rpx 48rpx;
      box-sizing: border-box;
      margin-bottom: 40rpx;
      background-color: #fff;
      .title {
        height: 65rpx;
        text-align: center;
        color: #333333;
        font-size: 28rpx;
      }
      .content {
        width: 100%;
        height: 641rpx;
        border-top: 1rpx solid #eeeeee;
        border-bottom: 1rpx solid #eeeeee;
        .content-text {
          height: 92rpx;
          line-height: 92rpx;
          display: flex;
          justify-content: space-between;
          .one {
            font-size: 28rpx;
            color: #999999;
          }
          .two {
            font-size: 28rpx;
            color: #666666;
          }
        }
      }
      .tbs {
        width: 100%;
        margin-top: 24rpx;
        .u-button {
          border-radius: 16rpx;
        }
      }
    }
  }
}
</style>
